package com.ruoyi.project.channel.businessRate.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.channel.businessRate.mapper.BusinessRateMapper;
import com.ruoyi.project.channel.businessRate.domain.BusinessRate;
import com.ruoyi.project.channel.businessRate.service.IBusinessRateService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 商户对应通道费率 服务层实现
 * 
 * @author zero
 * @date 2019-05-12
 */
@Service
public class BusinessRateServiceImpl implements IBusinessRateService 
{
	@Autowired
	private BusinessRateMapper businessRateMapper;

	/**
     * 查询商户对应通道费率信息
     * 
     * @param rateId 商户对应通道费率ID
     * @return 商户对应通道费率信息
     */
    @Override
	public BusinessRate selectBusinessRateById(Long rateId)
	{
	    return businessRateMapper.selectBusinessRateById(rateId);
	}
	
	/**
     * 查询商户对应通道费率列表
     * 
     * @param businessRate 商户对应通道费率信息
     * @return 商户对应通道费率集合
     */
	@Override
	public List<BusinessRate> selectBusinessRateList(BusinessRate businessRate)
	{
	    return businessRateMapper.selectBusinessRateList(businessRate);
	}
	
    /**
     * 新增商户对应通道费率
     * 
     * @param businessRate 商户对应通道费率信息
     * @return 结果
     */
	@Override
	public int insertBusinessRate(BusinessRate businessRate)
	{
	    return businessRateMapper.insertBusinessRate(businessRate);
	}
	
	/**
     * 修改商户对应通道费率
     * 
     * @param businessRate 商户对应通道费率信息
     * @return 结果
     */
	@Override
	public int updateBusinessRate(BusinessRate businessRate)
	{
	    return businessRateMapper.updateBusinessRate(businessRate);
	}

	/**
     * 删除商户对应通道费率对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBusinessRateByIds(String ids)
	{
		return businessRateMapper.deleteBusinessRateByIds(Convert.toStrArray(ids));
	}

	/**
	 * 批量设置状态
	 *
	 * @param ids 需要设置的数据ID
	 * @return 结果
	 */
	public int setBusinessRateStatusByIds(String ids,String useStatus){
		return businessRateMapper.setUseStatus(Convert.toStrArray(ids),useStatus);
	}
	
}
